﻿using Elektronix.Class;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Elektronix
{
    public partial class details : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {


        }

        protected void lbSepet_Click(object sender, EventArgs e)
        {
            if (Session["userID"] != null)
            {
                siparisler s = new siparisler();
                s.userID = Session["userID"].ToString();
                string kuki = "sepet" + s.userID;
                     
                if (Request.Cookies[kuki] != null)
                {
                    s.sepet = Request.Cookies[kuki].Value.ToString();
                    if (Request.QueryString["pid"] != null)
                    {
                        s.sepet += "|" + Request.QueryString["pid"].ToString();
                        Response.Cookies[kuki].Expires = DateTime.Now.AddMinutes(-1);
                        Response.Cookies.Add(s.sepeteekle());
                    }
                }
                else
                {
                    if (Request.QueryString["pid"] != null)
                    {
                        s.sepet = "|" + Request.QueryString["pid"].ToString();
                        Response.Cookies.Add(s.sepeteekle());
                    }
                }

                Response.Redirect("default.aspx");
            }
            else
            {
                Response.Redirect("login.aspx");
            }
            


        }
    }
}